package com.joysuch.wwyt.attendant.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.joysuch.wwyt.attendant.bean.AttendantPlanBean;
import com.joysuch.wwyt.attendant.bean.AttendantPlanDetailBean;
import com.joysuch.wwyt.attendant.bean.AttendantPlanReqBean;
import com.joysuch.wwyt.attendant.bean.vo.AttendantStatisticsAreaVo;
import com.joysuch.wwyt.attendant.bean.vo.AttendantStatisticsUserVo;
import com.joysuch.wwyt.attendant.entity.AttendantPlan;
import com.joysuch.wwyt.core.common.ajax.ResultBean;
import com.joysuch.wwyt.core.exception.ApiBusinessException;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;

/**
 * @author xsx
 * @version 1.0
 * @date 2023/2/15 11:38
 */
public interface AttendantPlanService extends IService<AttendantPlan> {
    /**
     * 保存跟班计划
     *
     * @param bean
     */
    void saveAttendantPlan(AttendantPlanBean bean) throws ApiBusinessException;

    /**
     * 修改跟班计划
     *
     * @param bean
     */
    void updateAttendantPlan(AttendantPlanBean bean) throws ApiBusinessException;

    /**
     * 查询跟班计划详情
     * @param id
     * @return
     */
    AttendantPlanBean findAttendantPlanBean(Long id);

    /**
     * 查询跟班计划列表
     * @param reqBean
     * @return
     */
    Page<AttendantPlanDetailBean> selectPage(AttendantPlanReqBean reqBean);

    void delete(Long id);

    void deleteByIds(List<Long> ids);

    long countByStatus(Integer state);

    Page<AttendantStatisticsUserVo> findStatisticsUserPage(Page<AttendantStatisticsUserVo> page, List<Long> userIds,Long jobId, Integer way, Date startTime, Date endTime, String companyCode, Long tenantId);

    Page<AttendantStatisticsAreaVo> findStatisticsAreaPage(Page<AttendantStatisticsAreaVo> page, List<Long> areaIds, Integer way, Date startTime, Date endTime, String companyCode, Long currentTenantId);

    List<AttendantPlan> selectByTime(Date date,Integer state,Integer way);

    /**
     * 批量导入
     * @param way
     * @param file
     * @return
     */
    List<String> importExcelData(Integer way, MultipartFile file) throws Exception;

    ResultBean export(String ids ,HttpServletResponse response);
}
